package com.shike.hq.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Mvc配置类，设置对应路径的视图层名称。
 */
@Configuration
public class MyMvcConfig implements WebMvcConfigurer {

    // 访问路径
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
//        registry.addViewController("/").setViewName("login");
//        registry.addViewController("/index").setViewName("index");
    }

    // 拦截器
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(new LoginInterceptor())
//            .addPathPatterns("/**")
//            .excludePathPatterns("/loginPage")
//            .excludePathPatterns("/loginPage/login")
//            .excludePathPatterns("/static/**","/dist/**","/plugins/**");
//    }
}

